package cn.tedu.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;


@Controller
public class UserController {
   //@Autowired(required = false)
   //@Resource javax提供的,跟Autowired等效
    private UserMapper userMapper;
    public UserController() {
    }
    @Autowired
    public UserController(UserMapper userMapper) {
        this.userMapper = userMapper;
    }


    public void reg(){
        System.out.println("UserController.reg() >> 控制器即将执行用户注册……");
        userMapper.insert();
    }
}
